import 'package:json_annotation/json_annotation.dart';

part 'withdraw.g.dart';

@JsonSerializable()
class Withdraw {
  static const NOT_APPLY = 'NOT_APPLY'; // 状态，允许删除和申请审核
  static const AUDITING = 'AUDITING'; // 状态，允许撤回
  static const AUDIT_FAIL = 'AUDIT_FAIL'; // 状态，允许撤回
  static const AUDIT_SUCCESS = 'AUDIT_SUCCESS'; // 状态，不允许用户操作

  final int id;
  final int storeId;
  final String storeName;
  final String accountType;
  final String accountTypeName;
  final double amount;
  final double serviceFee;
  final String bankCardId;
  final String cardOwnerName;
  final String bankAddress;
  final String auditStatus; // NOT_APPLY、AUDITING、AUDIT_FAIL、AUDIT_SUCCESS
  final String auditStatusName;
  final String auditNote;
  final String bankCode;
  final String withdrawTime;
  final String statusText;
  final String createTime;

  Withdraw(
    this.id,
    this.storeId,
    this.storeName,
    this.accountType,
    this.accountTypeName,
    this.amount,
    this.serviceFee,
    this.bankCardId,
    this.cardOwnerName,
    this.bankAddress,
    this.auditStatus,
    this.auditStatusName,
    this.auditNote,
    this.bankCode,
    this.withdrawTime,
    this.statusText,
    this.createTime,
  );

  factory Withdraw.fromJson(Map<String, dynamic> json) => _$WithdrawFromJson(json);

  Map<String, dynamic> toJson() => _$WithdrawToJson(this);
}
